package com.autoplaza;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.util.ArrayList;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnCancelListener;
import android.database.DataSetObserver;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;

public class ContactoFeedback extends Activity {
	public EditText etnombre, etemail, ettelefono, etidanuncio, etcomentarios;
	public Spinner spasunto, spcomentario, spestado, splada;
	public String strspasunto, strspcomentario, strspestado, strsplada, result, ladactual;
	public int estadoid, asuntosid, ladasid, comentariosid, comentarioidcomunicacion;
	public String[] estados={"Seleccione","Aguascalientes","Baja California","Baja California Sur","Campeche","Chiapas","Chihuahua",
			"Coahuila","Colima","Durango","Estado de México","Guanajuato","Guerrero","Hidalgo","Jalisco","Distrito Federal",
			"Michoacán","Morelos","Nayarit", "Nuevo Leén","Oaxaca","Puebla","Querétaro","Quintana Roo",
			"San Luis Potosí","Sinaloa","Sonora","Tabasco","Tamaulipas","Tlaxcala","Veracruz","Yucatán",
	"Zacatecas"};
	public String[] asuntos={"Seleccione","Queja","Sugerencia","Comentario","Otro"};
	public String[] ladasFiltro;
	public String[] comentarioFiltro, arrayidcomunicacion, arrayladas;
	public Button btenviar, btnmenu;
	public ProgressDialog progressDialog;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.contactofeedback);
		
		btnmenu = (Button) findViewById(R.id.btn_menu);
		btnmenu.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {

				Intent goManuLateral = new Intent(ContactoFeedback.this, MenuLateral.class);
				goManuLateral.putExtra("clase","ContactoFeedback");
				startActivity(goManuLateral);

			}
		});
		
		int size = Utils.getScreenSize2(ContactoFeedback.this);
		if( size == 1){
			RelativeLayout lin = (RelativeLayout) findViewById(R.id.linearLayout1);
			lin.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 30));
			RelativeLayout.LayoutParams params0 = new RelativeLayout.LayoutParams(25, 25);
			params0.addRule(RelativeLayout.CENTER_HORIZONTAL);
			params0.addRule(RelativeLayout.CENTER_VERTICAL);
			params0.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
			btnmenu.setLayoutParams(params0);
//			btnmenu.setLayoutParams(new LinearLayout.LayoutParams(30, 30));
		}		
		if( size == 2){
			RelativeLayout lin = (RelativeLayout) findViewById(R.id.linearLayout1);
			lin.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 60));	
			RelativeLayout.LayoutParams params0 = new RelativeLayout.LayoutParams(50, 50);
			params0.addRule(RelativeLayout.CENTER_HORIZONTAL);
			params0.addRule(RelativeLayout.CENTER_VERTICAL);
			params0.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
			btnmenu.setLayoutParams(params0);
//			btnmenu.setLayoutParams(new LinearLayout.LayoutParams(45, 45));

		}		
		if( size == 3){
			RelativeLayout lin = (RelativeLayout) findViewById(R.id.linearLayout1);
			lin.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 80));
			RelativeLayout.LayoutParams params0 = new RelativeLayout.LayoutParams(70, 70);
			params0.addRule(RelativeLayout.CENTER_HORIZONTAL);
			params0.addRule(RelativeLayout.CENTER_VERTICAL);
			params0.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
			btnmenu.setLayoutParams(params0);
//			btnmenu.setLayoutParams(new LinearLayout.LayoutParams(80, 80));

		}

		etnombre = (EditText) findViewById(R.id.et_contacto_nombre);
		etemail = (EditText) findViewById(R.id.et_contacto_email);
		ettelefono = (EditText) findViewById(R.id.et_contacto_telefono);
		etidanuncio = (EditText) findViewById(R.id.et_contacto_anuncioid);
		etcomentarios = (EditText) findViewById(R.id.et_contacto_comentario);
		spasunto = (Spinner) findViewById(R.id.sp_contacto_asunto);
		spcomentario = (Spinner) findViewById(R.id.sp_contacto_comentario);
		spestado = (Spinner) findViewById(R.id.sp_contacto_estado);
		splada = (Spinner) findViewById(R.id.sp_contacto_lada);
		btenviar = (Button) findViewById(R.id.btn_contacto_enviar);

		ArrayAdapter<String> adapter_estados = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, estados);
		ArrayAdapter<String> adapter_asuntos = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, asuntos);
		adapter_estados.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		adapter_asuntos.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);



		spasunto.setAdapter(adapter_asuntos);
		spestado.setAdapter(adapter_estados);

		spasunto.setOnItemSelectedListener(new OnItemSelectedListener() {

			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {
				strspasunto = asuntos[arg2];
				asuntosid = arg2;
				Log.i("strspasunto", ""+strspasunto);
				comentarioFiltro = filtroComentario();
				ArrayAdapter<String> adapter_comentario = 
						new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, comentarioFiltro);
				adapter_comentario.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
				spcomentario.setAdapter(adapter_comentario);
				spcomentario.setOnItemSelectedListener(new OnItemSelectedListener() {

					@Override
					public void onItemSelected(AdapterView<?> arg0, View arg1,
							int arg2, long arg3) {
						comentariosid = arg2;
						comentarioidcomunicacion = Integer.parseInt(arrayidcomunicacion[arg2]);
					}

					@Override
					public void onNothingSelected(AdapterView<?> arg0) {

					}
				});

			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {
			}
		});

		spestado.setOnItemSelectedListener(new OnItemSelectedListener() {

			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {
				strspestado = estados[arg2];
				estadoid = arg2;
				Log.i("strspestado "+strspestado, " estadoid "+estadoid);
				ladasFiltro = filtroLada();
				ArrayAdapter<String> adapter_ladas = 
						new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_spinner_item, ladasFiltro);
				adapter_ladas.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);				
				splada.setAdapter(adapter_ladas);
				splada.setOnItemSelectedListener(new OnItemSelectedListener() {

					@Override
					public void onItemSelected(AdapterView<?> arg0, View arg1,
							int arg2, long arg3) {
						ladasid = arg2;
						ladactual = ladasFiltro[arg2];
						
					}

					@Override
					public void onNothingSelected(AdapterView<?> arg0) {
						// TODO Auto-generated method stub

					}
				});

			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {

			}
		});

		btenviar.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				new AsyncEnviar().execute();
			}
		});

	}


	public class AsyncEnviar extends AsyncTask<Void, Void, Void>{
		int flag = 0;
		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			//			progressDialog = ProgressDialog.show(ContactoFeedback.this, "",
			//					"Cargando...", true, true, new OnCancelListener() {
			//						
			//						@Override
			//						public void onCancel(DialogInterface arg0) {
			//							finish();
			//						}
			//			});

		}

		@Override
		protected Void doInBackground(Void... params) {
			if(Utils.isOnline(getApplicationContext())){
				if(etcomentarios.getText().toString().equals("")){
					flag = 9;
				}
				if(etemail.getText().toString().equals("")){
					flag = 3;
				}
				if(ettelefono.getText().toString().equals("")){
					flag = 4;
				}
				if(etnombre.getText().toString().equals("")){
					flag = 2;
				}
				if(comentariosid == 0){
					flag = 8;
				}
				if(ladasid == 0){
					flag = 7;
				}
				if(asuntosid == 0){
					flag = 5;
				}
				if(estadoid == 0){
					flag = 6;
				}	

			}else{
				flag = 1;

			}

			return null;
		}

		@Override
		protected void onPostExecute(Void result) {
			super.onPostExecute(result);
			if(flag == 1){
				//No internet

			}else{
				Log.i("FLAG", ""+flag);
				AlertDialog.Builder builder = new AlertDialog.Builder(ContactoFeedback.this);
				builder.setTitle("Autoplaza").
				setCancelable(false).
				setPositiveButton("Aceptar", new DialogInterface.OnClickListener() {
					public void onClick(DialogInterface dialog, int id) {

					}
				});

				if(flag == 2){
					builder.setMessage("Debe introducir su nombre");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 3){
					builder.setMessage("Debe introducir su e-mail");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 4){
					builder.setMessage("Debe introducir su teléfono");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 5){
					builder.setMessage("Debe seleccionar el asunto");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 6){
					builder.setMessage("Debe seleccionar el estado");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 7){
					builder.setMessage("Debe seleccionar la clave lada");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 8){
					builder.setMessage("Debe seleccionar el tipo de comentario");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 9){
					builder.setMessage("Debe introducir sus comentarios");
					AlertDialog alertDialog = builder.create();
					alertDialog.show();
				}
				if(flag == 0){
					enviarMail();
				}



			}

		}
	}


	public void enviarMail() {
		InputStream is = null;

		try{
			String url = "http://www.autoplaza.com.mx/systems/AtencionQueja/xt_atenciondetalleIphone.asp?Nombre="+etnombre.getText().toString()+
					"&Email="+etemail.getText().toString()+"&Combocomentarios="+comentarioidcomunicacion+"&Comentario="+etcomentarios.getText().toString()+
					"&telof1="+ladactual+"&telof2="+ettelefono.getText().toString()+"&NoAnuncio="+etidanuncio.getText().toString();
			

			Log.i("URL", ""+url);

			URI myURI = null;
			try {
				myURI = new URI(url);
			} catch (URISyntaxException e) {
			}
			HttpClient httpClient = new DefaultHttpClient();
			HttpGet getMethod = new HttpGet(myURI);
			HttpResponse webServerResponse = null;
			try {
				webServerResponse = httpClient.execute(getMethod);
			} catch (ClientProtocolException e) {
			} catch (IOException e) {
			}

			HttpEntity httpEntity = webServerResponse.getEntity();

			if (httpEntity != null) {
				try {
					is = httpEntity.getContent();
					BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
					StringBuilder sb = new StringBuilder();
					String line = null;
					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result=sb.toString();
					Log.i("response", ""+result);

				} catch (IllegalStateException e) {
					e.printStackTrace();
				} catch (IOException e) {
					e.printStackTrace();
				}

			}

		}catch (Exception e) {
		}

	}


	public String[] filtroLada(){
		ArrayList<Lada> ladas = getLadas();
		ArrayList<Lada> ladasnuevo = new ArrayList<Lada>();
		ladasnuevo.add(new Lada("Seleccione"));
		Log.i("ladas size", ""+ladas.size());
		int tam = ladas.size();
		for(int i = 0; i < tam; i++){
			if( (ladas.get(i).est_idr == (estadoid)) ){
				ladasnuevo.add(ladas.get(i));
				Log.i("lada add", ""+ladas.get(i).est_idr);

			}else{
				Log.i("lada not add", ""+ladas.get(i).est_idr);
			}
		}
		Log.i("ladas nuevo", ""+ladasnuevo.size());

		String[] arrayladas = new String[ladasnuevo.size()];
		arrayidcomunicacion = new String[ladasnuevo.size()];
		
		
		for(int i = 0; i < arrayladas.length; i++){
			if(i == 0){
				arrayladas[i]  = ladasnuevo.get(i).firstElement;
				arrayidcomunicacion[i]  = ""+ladasnuevo.get(i).clave;

			}else{
				arrayladas[i]  = ""+ladasnuevo.get(i).clave;
				arrayidcomunicacion[i]  = ""+ladasnuevo.get(i).clave;

			}
		}
		return arrayladas;	
	}

	public String[] filtroComentario(){
		ArrayList<Comentario> comentarios = getComentarios();
		ArrayList<Comentario> comentariosnuevo = new ArrayList<Comentario>();
		comentariosnuevo.add(new Comentario("Seleccione"));
		Log.i("ladas size", ""+comentarios.size());
		int tam = comentarios.size();
		for(int i = 0; i < tam; i++){
			if( (comentarios.get(i).id_motivo == (asuntosid)) ){
				comentariosnuevo.add(comentarios.get(i));
				Log.i("comentario add", ""+comentarios.get(i).id_motivo);

			}else{
				Log.i("comentario not add", ""+comentarios.get(i).id_motivo);
			}
		}
		Log.i("comentario nuevo", ""+comentariosnuevo.size());
		String[] arraycomentario = new String[comentariosnuevo.size()];
		arrayidcomunicacion = new String[comentariosnuevo.size()];

		for(int i = 0; i < arraycomentario.length; i++){
			if(i == 0){
				arraycomentario[i]  = comentariosnuevo.get(i).firstElement;
				arrayidcomunicacion[i]  = ""+comentariosnuevo.get(i).id_comunicacion;

			}else{
				arraycomentario[i]  = comentariosnuevo.get(i).texto;
				arrayidcomunicacion[i]  = ""+comentariosnuevo.get(i).id_comunicacion;

			}
		}
		return arraycomentario;
	}

	public class Comentario{
		int id_motivo;
		int id_comunicacion;
		String texto;
		String firstElement;

		public Comentario(int id_motivo, int id_comunicacion, String texto) {
			this.id_motivo = id_motivo;
			this.id_comunicacion = id_comunicacion;
			this.texto = texto;
		}

		public Comentario(String first){
			this.firstElement = first;
		}

	}

	public ArrayList<Comentario> getComentarios(){
		ArrayList<Comentario> comentario = new ArrayList<Comentario>();
		comentario.add(new Comentario(1, 1, "Falta de Información"));
		comentario.add(new Comentario(1, 2, "Existen muchas preguntas inecesarias"));
		comentario.add(new Comentario(1, 3, "La página es muy lenta"));
		comentario.add(new Comentario(1, 4, "Otros"));
		comentario.add(new Comentario(2, 5, "Me Agradaría que se ofrecieran  otros servicios"));
		comentario.add(new Comentario(2, 7, "Dejar un apartado para anuncios especiales"));
		comentario.add(new Comentario(2, 8, "Otros"));
		comentario.add(new Comentario(3, 9, "Libre"));
		comentario.add(new Comentario(3, 11, "Servicios"));
		comentario.add(new Comentario(3, 12, "Otros"));
		comentario.add(new Comentario(4, 13, "Envio de Felicitación por su página"));
		comentario.add(new Comentario(4, 14, "Solicitud de nuevos servicios"));
		comentario.add(new Comentario(4, 15, "Necesidades relacionados a mi coche"));

		return comentario;
	}


	public class Lada{
		int est_idr;
		int clave;
		String firstElement;

		public Lada(int est_idr, int clave) {
			this.est_idr = est_idr;
			this.clave = clave;
		}

		public Lada(String first){
			firstElement = first;
		}

	}



	public ArrayList<Lada> getLadas(){
		ArrayList<Lada> ladas = new ArrayList<Lada>();
		ladas.add(new Lada(1, 449));
		ladas.add(new Lada(1, 458));
		ladas.add(new Lada(1, 465));
		ladas.add(new Lada(1, 495));
		ladas.add(new Lada(1, 496));
		ladas.add(new Lada(2, 616));
		ladas.add(new Lada(2, 646));
		ladas.add(new Lada(2, 653));
		ladas.add(new Lada(2, 658));
		ladas.add(new Lada(2, 661));
		ladas.add(new Lada(2, 664));
		ladas.add(new Lada(2, 665));
		ladas.add(new Lada(2, 686));
		ladas.add(new Lada(3, 612));
		ladas.add(new Lada(3, 613));
		ladas.add(new Lada(3, 615));
		ladas.add(new Lada(3, 624));
		ladas.add(new Lada(4, 913));
		ladas.add(new Lada(4, 938));
		ladas.add(new Lada(4, 981));
		ladas.add(new Lada(4, 982));
		ladas.add(new Lada(4, 983));
		ladas.add(new Lada(4, 996));
		ladas.add(new Lada(5, 916));
		ladas.add(new Lada(5, 917));
		ladas.add(new Lada(5, 918));
		ladas.add(new Lada(5, 919));
		ladas.add(new Lada(5, 932));
		ladas.add(new Lada(5, 934));
		ladas.add(new Lada(5, 961));
		ladas.add(new Lada(5, 962));
		ladas.add(new Lada(5, 963));
		ladas.add(new Lada(5, 964));
		ladas.add(new Lada(5, 965));
		ladas.add(new Lada(5, 966));
		ladas.add(new Lada(5, 967));
		ladas.add(new Lada(5, 968));
		ladas.add(new Lada(5, 992));
		ladas.add(new Lada(5, 994));
		ladas.add(new Lada(6, 114));
		ladas.add(new Lada(6, 621));
		ladas.add(new Lada(6, 625));
		ladas.add(new Lada(6, 626));
		ladas.add(new Lada(6, 627));
		ladas.add(new Lada(6, 628));
		ladas.add(new Lada(6, 629));
		ladas.add(new Lada(6, 635));
		ladas.add(new Lada(6, 636));
		ladas.add(new Lada(6, 639));
		ladas.add(new Lada(6, 648));
		ladas.add(new Lada(6, 649));
		ladas.add(new Lada(6, 652));
		ladas.add(new Lada(6, 656));
		ladas.add(new Lada(6, 659));
		ladas.add(new Lada(7, 671));
		ladas.add(new Lada(7, 842));
		ladas.add(new Lada(7, 844));
		ladas.add(new Lada(7, 861));
		ladas.add(new Lada(7, 862));
		ladas.add(new Lada(7, 864));
		ladas.add(new Lada(7, 866));
		ladas.add(new Lada(7, 867));
		ladas.add(new Lada(7, 869));
		ladas.add(new Lada(7, 871));
		ladas.add(new Lada(7, 872));
		ladas.add(new Lada(7, 873));
		ladas.add(new Lada(7, 877));
		ladas.add(new Lada(7, 878));
		ladas.add(new Lada(8, 312));
		ladas.add(new Lada(8, 313));
		ladas.add(new Lada(8, 314));
		ladas.add(new Lada(9, 618));
		ladas.add(new Lada(9, 629));
		ladas.add(new Lada(9, 649));
		ladas.add(new Lada(9, 671));
		ladas.add(new Lada(9, 674));
		ladas.add(new Lada(9, 675));
		ladas.add(new Lada(9, 676));
		ladas.add(new Lada(9, 677));
		ladas.add(new Lada(9, 871));
		ladas.add(new Lada(9, 872));
		ladas.add(new Lada(10,55 ));
		ladas.add(new Lada(10,427 ));
		ladas.add(new Lada(10,588 ));
		ladas.add(new Lada(10,591 ));
		ladas.add(new Lada(10,592 ));
		ladas.add(new Lada(10,593 ));
		ladas.add(new Lada(10,594 ));
		ladas.add(new Lada(10,595 ));
		ladas.add(new Lada(10,596 ));
		ladas.add(new Lada(10,597 ));
		ladas.add(new Lada(10,599 ));
		ladas.add(new Lada(10,711 ));
		ladas.add(new Lada(10,712 ));
		ladas.add(new Lada(10,713 ));
		ladas.add(new Lada(10,714 ));
		ladas.add(new Lada(10,716 ));
		ladas.add(new Lada(10,717 ));
		ladas.add(new Lada(10,718 ));
		ladas.add(new Lada(10,719 ));
		ladas.add(new Lada(10,721 ));
		ladas.add(new Lada(10,722 ));
		ladas.add(new Lada(10,723 ));
		ladas.add(new Lada(10,724 ));
		ladas.add(new Lada(10,725 ));
		ladas.add(new Lada(10,726 ));
		ladas.add(new Lada(10,728 ));
		ladas.add(new Lada(10,761 ));
		ladas.add(new Lada(10, 767));
		ladas.add(new Lada(11, 352));
		ladas.add(new Lada(11, 411));
		ladas.add(new Lada(11, 412));
		ladas.add(new Lada(11, 413));
		ladas.add(new Lada(11, 415));
		ladas.add(new Lada(11, 417));
		ladas.add(new Lada(11, 418));
		ladas.add(new Lada(11, 419));
		ladas.add(new Lada(11, 421));
		ladas.add(new Lada(11, 428));
		ladas.add(new Lada(11, 429));
		ladas.add(new Lada(11, 432));
		ladas.add(new Lada(11, 438));
		ladas.add(new Lada(11, 442));
		ladas.add(new Lada(11, 445));
		ladas.add(new Lada(11, 456));
		ladas.add(new Lada(11, 461));
		ladas.add(new Lada(11, 462));
		ladas.add(new Lada(11, 464));
		ladas.add(new Lada(11, 466));
		ladas.add(new Lada(11, 468));
		ladas.add(new Lada(11, 469));
		ladas.add(new Lada(11, 462));
		ladas.add(new Lada(11, 473));
		ladas.add(new Lada(11, 476));
		ladas.add(new Lada(11, 477));
		ladas.add(new Lada(12, 721));
		ladas.add(new Lada(12, 732));
		ladas.add(new Lada(12, 733));
		ladas.add(new Lada(12, 736));
		ladas.add(new Lada(12, 741));
		ladas.add(new Lada(12, 742));
		ladas.add(new Lada(12, 744));
		ladas.add(new Lada(12, 745));
		ladas.add(new Lada(12, 747));
		ladas.add(new Lada(12, 753));
		ladas.add(new Lada(12, 754));
		ladas.add(new Lada(12, 755));
		ladas.add(new Lada(12, 756));
		ladas.add(new Lada(12, 757));
		ladas.add(new Lada(12, 758));
		ladas.add(new Lada(12, 762));
		ladas.add(new Lada(12, 767));
		ladas.add(new Lada(12, 781));
		ladas.add(new Lada(13, 427));
		ladas.add(new Lada(13, 441));
		ladas.add(new Lada(13, 483));
		ladas.add(new Lada(13, 591));
		ladas.add(new Lada(13, 738));
		ladas.add(new Lada(13, 743));
		ladas.add(new Lada(13, 746));
		ladas.add(new Lada(13, 748));
		ladas.add(new Lada(13, 759));
		ladas.add(new Lada(13, 761));
		ladas.add(new Lada(13, 763));
		ladas.add(new Lada(13, 771));
		ladas.add(new Lada(13, 772));
		ladas.add(new Lada(13, 773));
		ladas.add(new Lada(13, 774));
		ladas.add(new Lada(13, 775));
		ladas.add(new Lada(13, 776));
		ladas.add(new Lada(13, 778));
		ladas.add(new Lada(13, 779));
		ladas.add(new Lada(13, 789));
		ladas.add(new Lada(13, 791));
		ladas.add(new Lada(14, 33));
		ladas.add(new Lada(14, 312));
		ladas.add(new Lada(14, 315));
		ladas.add(new Lada(14, 316));
		ladas.add(new Lada(14, 317));
		ladas.add(new Lada(14, 321));
		ladas.add(new Lada(14, 322));
		ladas.add(new Lada(14, 326));
		ladas.add(new Lada(14, 341));
		ladas.add(new Lada(14, 342));
		ladas.add(new Lada(14, 343));
		ladas.add(new Lada(14, 344));
		ladas.add(new Lada(14, 345));
		ladas.add(new Lada(14, 346));
		ladas.add(new Lada(14, 347));
		ladas.add(new Lada(14, 348));
		ladas.add(new Lada(14, 349));
		ladas.add(new Lada(14, 354));
		ladas.add(new Lada(14, 357));
		ladas.add(new Lada(14, 358));
		ladas.add(new Lada(14, 371));
		ladas.add(new Lada(14, 372));
		ladas.add(new Lada(14, 373));
		ladas.add(new Lada(14, 374));
		ladas.add(new Lada(14, 375));
		ladas.add(new Lada(14, 376));
		ladas.add(new Lada(14, 377));
		ladas.add(new Lada(14, 378));
		ladas.add(new Lada(14, 382));
		ladas.add(new Lada(14, 384));
		ladas.add(new Lada(14, 385));
		ladas.add(new Lada(14, 386));
		ladas.add(new Lada(14, 387));
		ladas.add(new Lada(14, 388));
		ladas.add(new Lada(14, 391));
		ladas.add(new Lada(14, 392));
		ladas.add(new Lada(14, 393));
		ladas.add(new Lada(14, 395));
		ladas.add(new Lada(14, 424));
		ladas.add(new Lada(14, 431));
		ladas.add(new Lada(14, 437));
		ladas.add(new Lada(14, 457));
		ladas.add(new Lada(14, 474));
		ladas.add(new Lada(14, 475));
		ladas.add(new Lada(14, 495));
		ladas.add(new Lada(14, 496));
		ladas.add(new Lada(14, 499));
		ladas.add(new Lada(15, 55));
		ladas.add(new Lada(16, 313));
		ladas.add(new Lada(16, 328));
		ladas.add(new Lada(16, 351));
		ladas.add(new Lada(16, 352));
		ladas.add(new Lada(16, 353));
		ladas.add(new Lada(16, 354));
		ladas.add(new Lada(16, 355));
		ladas.add(new Lada(16, 356));
		ladas.add(new Lada(16, 359));
		ladas.add(new Lada(16, 381));
		ladas.add(new Lada(16, 383));
		ladas.add(new Lada(16, 393));
		ladas.add(new Lada(16, 394));
		ladas.add(new Lada(16, 422));
		ladas.add(new Lada(16, 423));
		ladas.add(new Lada(16, 424));
		ladas.add(new Lada(16, 425));
		ladas.add(new Lada(16, 426));
		ladas.add(new Lada(16, 434));
		ladas.add(new Lada(16, 435));
		ladas.add(new Lada(16, 436));
		ladas.add(new Lada(16, 438));
		ladas.add(new Lada(16, 443));
		ladas.add(new Lada(16, 447));
		ladas.add(new Lada(16, 451));
		ladas.add(new Lada(16, 452));
		ladas.add(new Lada(16, 453));
		ladas.add(new Lada(16, 454));
		ladas.add(new Lada(16, 455));
		ladas.add(new Lada(16, 459));
		ladas.add(new Lada(16, 471));
		ladas.add(new Lada(16, 711));
		ladas.add(new Lada(16, 715));
		ladas.add(new Lada(16, 753));
		ladas.add(new Lada(16, 786));
		ladas.add(new Lada(17, 731));
		ladas.add(new Lada(17, 734));
		ladas.add(new Lada(17, 735));
		ladas.add(new Lada(17, 737));
		ladas.add(new Lada(17, 739));
		ladas.add(new Lada(17, 751));
		ladas.add(new Lada(17, 769));
		ladas.add(new Lada(17, 777));
		ladas.add(new Lada(18, 311));
		ladas.add(new Lada(18, 319));
		ladas.add(new Lada(18, 322));
		ladas.add(new Lada(18, 323));
		ladas.add(new Lada(18, 324));
		ladas.add(new Lada(18, 325));
		ladas.add(new Lada(18, 327));
		ladas.add(new Lada(18, 329));
		ladas.add(new Lada(18, 389));
		ladas.add(new Lada(19, 81));
		ladas.add(new Lada(19, 488));
		ladas.add(new Lada(19, 821));
		ladas.add(new Lada(19, 823));
		ladas.add(new Lada(19, 824));
		ladas.add(new Lada(19, 825));
		ladas.add(new Lada(19, 826));
		ladas.add(new Lada(19, 827));
		ladas.add(new Lada(19, 828));
		ladas.add(new Lada(19, 829));
		ladas.add(new Lada(19, 867));
		ladas.add(new Lada(19, 873));
		ladas.add(new Lada(19, 892));
		ladas.add(new Lada(20, 236));
		ladas.add(new Lada(20, 274));
		ladas.add(new Lada(20, 281));
		ladas.add(new Lada(20, 283));
		ladas.add(new Lada(20, 287));
		ladas.add(new Lada(20, 741));
		ladas.add(new Lada(20, 757));
		ladas.add(new Lada(20, 924));
		ladas.add(new Lada(20, 951));
		ladas.add(new Lada(20, 953));
		ladas.add(new Lada(20, 954));
		ladas.add(new Lada(20, 958));
		ladas.add(new Lada(20, 971));
		ladas.add(new Lada(20, 972));
		ladas.add(new Lada(20, 994));
		ladas.add(new Lada(20, 995));
		ladas.add(new Lada(21, 222));
		ladas.add(new Lada(21, 223));
		ladas.add(new Lada(21, 224));
		ladas.add(new Lada(21, 227));
		ladas.add(new Lada(21, 231));
		ladas.add(new Lada(21, 232));
		ladas.add(new Lada(21, 233));
		ladas.add(new Lada(21, 236));
		ladas.add(new Lada(21, 237));
		ladas.add(new Lada(21, 238));
		ladas.add(new Lada(21, 243));
		ladas.add(new Lada(21, 244));
		ladas.add(new Lada(21, 245));
		ladas.add(new Lada(21, 248));
		ladas.add(new Lada(21, 249));
		ladas.add(new Lada(21, 275));
		ladas.add(new Lada(21, 276));
		ladas.add(new Lada(21, 282));
		ladas.add(new Lada(21, 746));
		ladas.add(new Lada(21, 764));
		ladas.add(new Lada(21, 776));
		ladas.add(new Lada(21, 797));
		ladas.add(new Lada(21, 953));
		ladas.add(new Lada(22, 414));
		ladas.add(new Lada(22, 419));
		ladas.add(new Lada(22, 427));
		ladas.add(new Lada(22, 441));
		ladas.add(new Lada(22, 442));
		ladas.add(new Lada(22, 448));
		ladas.add(new Lada(22, 487));
		ladas.add(new Lada(22, 761));
		ladas.add(new Lada(23, 983));
		ladas.add(new Lada(23, 984));
		ladas.add(new Lada(23, 987));
		ladas.add(new Lada(23, 997));
		ladas.add(new Lada(23, 998));
		ladas.add(new Lada(24, 444));
		ladas.add(new Lada(24, 458));
		ladas.add(new Lada(24, 481));
		ladas.add(new Lada(24, 482));
		ladas.add(new Lada(24, 483));
		ladas.add(new Lada(24, 485));
		ladas.add(new Lada(24, 486));
		ladas.add(new Lada(24, 487));
		ladas.add(new Lada(24, 488));
		ladas.add(new Lada(24, 489));
		ladas.add(new Lada(24, 496));
		ladas.add(new Lada(24, 845));
		ladas.add(new Lada(25, 667));
		ladas.add(new Lada(25, 668));
		ladas.add(new Lada(25, 669));
		ladas.add(new Lada(25, 672));
		ladas.add(new Lada(25, 673));
		ladas.add(new Lada(25, 687));
		ladas.add(new Lada(25, 694));
		ladas.add(new Lada(25, 695));
		ladas.add(new Lada(25, 696));
		ladas.add(new Lada(25, 697));
		ladas.add(new Lada(25, 698));
		ladas.add(new Lada(26, 622));
		ladas.add(new Lada(26, 623));
		ladas.add(new Lada(26, 631));
		ladas.add(new Lada(26, 632));
		ladas.add(new Lada(26, 633));
		ladas.add(new Lada(26, 634));
		ladas.add(new Lada(26, 637));
		ladas.add(new Lada(26, 638));
		ladas.add(new Lada(26, 641));
		ladas.add(new Lada(26, 642));
		ladas.add(new Lada(26, 643));
		ladas.add(new Lada(26, 644));
		ladas.add(new Lada(26, 645));
		ladas.add(new Lada(26, 647));
		ladas.add(new Lada(26, 651));
		ladas.add(new Lada(26, 653));
		ladas.add(new Lada(26, 662));
		ladas.add(new Lada(27, 913));
		ladas.add(new Lada(27, 914));
		ladas.add(new Lada(27, 917));
		ladas.add(new Lada(27, 923));
		ladas.add(new Lada(27, 932));
		ladas.add(new Lada(27, 933));
		ladas.add(new Lada(27, 934));
		ladas.add(new Lada(27, 936));
		ladas.add(new Lada(27, 937));
		ladas.add(new Lada(27, 993));
		ladas.add(new Lada(28, 482));
		ladas.add(new Lada(28, 831));
		ladas.add(new Lada(28, 832));
		ladas.add(new Lada(28, 833));
		ladas.add(new Lada(28, 834));
		ladas.add(new Lada(28, 835));
		ladas.add(new Lada(28, 836));
		ladas.add(new Lada(28, 841));
		ladas.add(new Lada(28, 867));
		ladas.add(new Lada(28, 868));
		ladas.add(new Lada(28, 891));
		ladas.add(new Lada(28, 894));
		ladas.add(new Lada(28, 897));
		ladas.add(new Lada(28, 899));
		ladas.add(new Lada(29, 222));
		ladas.add(new Lada(29, 223));
		ladas.add(new Lada(29, 241));
		ladas.add(new Lada(29, 246));
		ladas.add(new Lada(29, 247));
		ladas.add(new Lada(29, 248));
		ladas.add(new Lada(29, 276));
		ladas.add(new Lada(29, 748));
		ladas.add(new Lada(29, 749));
		ladas.add(new Lada(30, 225));
		ladas.add(new Lada(30, 226));
		ladas.add(new Lada(30, 228));
		ladas.add(new Lada(30, 229));
		ladas.add(new Lada(30, 232));
		ladas.add(new Lada(30, 235));
		ladas.add(new Lada(30, 271));
		ladas.add(new Lada(30, 272));
		ladas.add(new Lada(30, 273));
		ladas.add(new Lada(30, 274));
		ladas.add(new Lada(30, 278));
		ladas.add(new Lada(30, 279));
		ladas.add(new Lada(30, 282));
		ladas.add(new Lada(30, 283));
		ladas.add(new Lada(30, 284));
		ladas.add(new Lada(30, 285));
		ladas.add(new Lada(30, 287));
		ladas.add(new Lada(30, 288));
		ladas.add(new Lada(30, 294));
		ladas.add(new Lada(30, 296));
		ladas.add(new Lada(30, 297));
		ladas.add(new Lada(30, 489));
		ladas.add(new Lada(30, 746));
		ladas.add(new Lada(30, 765));
		ladas.add(new Lada(30, 766));
		ladas.add(new Lada(30, 768));
		ladas.add(new Lada(30, 774));
		ladas.add(new Lada(30, 782));
		ladas.add(new Lada(30, 783));
		ladas.add(new Lada(30, 784));
		ladas.add(new Lada(30, 785));
		ladas.add(new Lada(30, 789));
		ladas.add(new Lada(30, 833));
		ladas.add(new Lada(30, 846));
		ladas.add(new Lada(30, 921));
		ladas.add(new Lada(30, 922));
		ladas.add(new Lada(30, 923));
		ladas.add(new Lada(30, 924));
		ladas.add(new Lada(31, 969));
		ladas.add(new Lada(31, 985));
		ladas.add(new Lada(31, 986));
		ladas.add(new Lada(31, 988));
		ladas.add(new Lada(31, 991));
		ladas.add(new Lada(31, 997));
		ladas.add(new Lada(31, 999));
		ladas.add(new Lada(32, 346));
		ladas.add(new Lada(32, 433));
		ladas.add(new Lada(32, 437));
		ladas.add(new Lada(32, 457));
		ladas.add(new Lada(32, 458));
		ladas.add(new Lada(32, 463));
		ladas.add(new Lada(32, 467));
		ladas.add(new Lada(32, 478));
		ladas.add(new Lada(32, 492));
		ladas.add(new Lada(32, 493));
		ladas.add(new Lada(32, 494));
		ladas.add(new Lada(32, 496));
		ladas.add(new Lada(32, 498));
		ladas.add(new Lada(32, 499));
		ladas.add(new Lada(32, 842));

		return ladas;
	}

}









